//
//  MZUIViewDemoViewController.m
//  MZToolkitDemo
//
//  Created by shenjialin on 2017/4/17.
//  Copyright © 2017年 Chris Yang. All rights reserved.
//

#import "MZUIViewDemoViewController.h"
#import "MZCategories.h"
#import "UIViewDemo.h"
@interface MZUIViewDemoViewController ()
@property (weak, nonatomic) IBOutlet UIViewDemo *demoView;
@property (weak, nonatomic) IBOutlet UIImageView *demoImageView;
@property (weak, nonatomic) IBOutlet UIImageView *demoImage;

@end

@implementation MZUIViewDemoViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    // Do any additional setup after loading the view.
    [_demoView mzAddTapActionWithBlock:^(UIGestureRecognizer *gestureRecoginzer) {
        UIAlertView *alertView=[[UIAlertView alloc] initWithTitle:@"提示" message:@"我被点击了" delegate:nil cancelButtonTitle:@"确认" otherButtonTitles: nil];
        [alertView show];
    }];
    [_demoView mzAddLongPressActionWithBlock:^(UIGestureRecognizer *gestureRecoginzer) {
        UIAlertView *alertView=[[UIAlertView alloc] initWithTitle:@"提示" message:@"我被长按了" delegate:nil cancelButtonTitle:@"确认" otherButtonTitles: nil];
        [alertView show];
    }];
    
    [self.demoImageView mzSetImageWithImageUrl:@"https://timgsa.baidu.com/timg?image&quality=80&size=b9999_10000&sec=1528193285561&di=47ca881effdd33135a8de96a3e96113d&imgtype=0&src=http%3A%2F%2Fimg5q.duitang.com%2Fuploads%2Fitem%2F201505%2F26%2F20150526212913_Z3efX.gif" withResultBlock:^(BOOL isSuccess) {
        if (isSuccess) {
            NSLog(@"成功");
        }else{
            NSLog(@"失败");
        }
    }];
    
//    self.demoImage.image=[UIImage imageNamed:@"test_girl.png"];
    self.demoImage.image=[[UIImage imageNamed:@"test_girl.png"] mzChangeWithSize:CGSizeMake(100, 100)];
    
}

- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end
